<style>
.magintop_5{
	margin-top: 5px;
}
textarea{
	font-family:Arial;
	font-size:13px;
}
.span_name{
	border:#DDD 1px solid;
	background:#ccc;
	padding: 0px 5px 2px 5px;
}

.list_group_select{
	padding: 20px;
}
.list_group_select li{
	margin: 3px 5px;
	float:left;
	padding: 0 0 0 5px;
}
.list_group_select li a{
	line-height: 28px;
	padding: 5px 30px 0px 5px;
	color:#FFF;
	cursor: pointer;
}
.list_group_select li.selected {
    background: none repeat scroll 0 0 #FDC660;
}
.list_group_select li.selected a{
	color: #000;
}

</style>
<script>

</script>
<?php
if (isset($_GET['id'])){
	$id = $_GET['id'];
	include("./module/connect.php");
	$sql = "select `id`, `name`, `path` FROM `photo_album` WHERE `ID` = ".$id;
	$result = @mysql_query($sql, $conn);

	if (@mysql_num_rows($result)=="1"){
		$row = @mysql_fetch_row($result); 
			$id = $row[0];
			$name = $row[1];
			$folder = $_SESSION[sess_login]['id'].'-'.$_SESSION[sess_login]['username'].'/'.$row[2];
	}
	@mysql_free_result($result);
	mysql_close($conn);
?>
  <fieldset>
    <legend> STEP 3 </legend> 
<form name="form_step_3" id="form_step_3"onsubmit="return false;">
<input type="hidden" value="3" name="step_name">
<input type="hidden" value="<?=$id ?>" name="idalbum">
<input type="hidden" name="iconalbum" id="iconalbum">
<input type="hidden" name="listdisplayalbum" id="listdisplayalbum" value="">
    <table width="100%" border="0" cellpadding="5" cellspacing="5">
  <tr>
    <td width="140" height="32" align="right" valign="middle">Album Title:  &nbsp;</td>
    <td valign="middle">  &nbsp; <span class="username_red"><?=$name ?></span></td>
  </tr>
  <tr>
    <td width="140" height="32" align="right" valign="top"><div class="magintop_5">Icon: &nbsp;</div></td>
    <td valign="middle"><div id="icon_set"></div>
      &nbsp; <input type="button" name="Submit2" value=" Select icon " onclick="togglethis();"/>
	  </td>
  </tr>
  <tr>
    <td width="140" height="32" align="right" valign="top"><div class="magintop_5">Display for: &nbsp;</div></td>
    <td valign="middle">&nbsp;
      <select name="display" id="display" onchange="select_display();">
        <option value="1" selected="selected">Public</option>
        <option value="2">Only My friends</option>
        <option value="0">Only me</option>
        <option value="custom">Customs...</option>
      </select><br />
	  <div id="list_display_full" style="display:none; padding: 0 0 3px 10px; margin: 5px; background:#EEE;">
    <div id="list_display_group" style="padding:4px 0px; clear:both;"><input type="button" value=" Group + " onclick="open_group_list();" style="float:left;"/><div id="group_return" style="line-height:22px;">&nbsp;</div></div>
    <div id="list_display_friend" style="padding:4px 0px; clear:both;"><input type="button" value=" Friend + " onclick="open_friend_list();" style="float:left;"/><div id="friend_return" style="line-height:22px;">&nbsp;</div></div>
      </div>
   </td>
  </tr>
  <tr>
    <td width="140" height="32" align="right" valign="middle">Display on main page: &nbsp;</td>
    <td valign="middle">&nbsp;
	 <select name="mainpagealbum">
        <option value="1" selected="selected">Yes</option>
        <option value="0">No</option>
      </select>
	</td>
  </tr>

  <tr>
    <td width="140" align="right" valign="top"><div class="magintop_5">Description:   &nbsp;</div></td>
    <td valign="top">
      &nbsp;<textarea name="descriptionalbum" cols="50" rows="5"></textarea>
     </td>
  </tr>

  <tr>
    <td width="140" height="40" align="right" valign="middle"> </td>
    <td align="left" valign="middle">
	&nbsp;<input type="button" name="bt_back" onclick="javascript:window.location.href = '?p=photo&m=new&step=2&id=<?=$id ?>';" value=" &nbsp;<< Back to more Upload &nbsp;"> <input type="submit" name="Submit" value=" &nbsp; Save & Done &nbsp; "></td>
  </tr>
</table>
</form>
</fieldset>
<div id="loadimage" class="smak_onpage"></div>
<div id="loadlistgroup" class="smak_onpage"></div>
<div id="loadlistfriend" class="smak_onpage"></div>
<?php
}
else {
	echo "Lỗi không truyền được dữ liệu. Xin liên hệ với Quản trị";
}
?>
<script>
	$.get('./module/photo/loadthumbforstep.php?fol=<?=$folder ?>', function(data) { $('#loadimage').html(data); });
	$.get('./module/photo/loadgroupforstep.php', function(data) { $('#loadlistgroup').html(data); });
	$.get('./module/photo/loadfriendforstep.php', function(data) { $('#loadlistfriend').html(data); });
</script>
